// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import FastClick from "fastclick";
// import VueRouter from "vue-router";
import App from "./App";
import router from "./router";

import Group from "./components/group/index";
import "./assets/css/common.css";
import {
  Drawer,
  Flexbox,
  FlexboxItem,
  Tab,
  TabItem,
  Sticky,
  Divider,
  XButton,
  Swiper,
  SwiperItem,
  Timeline,
  TimelineItem,
  GroupTitle,
  Cell,
  XInput,
  Selector,
  PopupPicker,
  XAddress,
  Datetime,
  XNumber,
  XTextarea,
  XSwitch,
  Checker,
  CheckerItem,
  TransferDom,
  Popup,
  // AjaxPlugin,
  ToastPlugin
} from "vux";

import Footer from "@/components/Footer";
import FormPreview from "./components/form-preview/index";
// import axios from 'axios';
import axiosInstance from "./js/httpConfig.js";

// import Home from "./components/Home";
// import Login from "./components/Login";
// import User from "./components/User";
// import Record_infor from "./components/Record_infor";
// import Mydeclare from "./components/Mydeclare";
// import Mydeclare1 from "./components/Mydeclare1";
// import Mydeclare_detail from "./components/Mydeclare_detail";
// import News from "./components/News";
// import News_detail from "./components/News_detail";
// import Question_detail from "./components/Question_detail";
// import Subscribe from "./components/Subscribe";
// import Service from "./components/Service";
// import Question from "./components/Question";
// import Check from "./components/Check";
// import Check_good_declare from "./components/Check_good_declare";
// import Check_good_information from "./components/Check_good_information";
// import Check_good_dynamic from "./components/Check_good_dynamic";
// import Check_inspection from "./components/Check_inspection";
// import Check_manifest from "./components/Check_manifest";
// import Check_inspection_1 from "./components/Check_inspection_1";
// import Check_good_declare_1 from "./components/Check_good_declare_1";
// import Check_good_information_1 from "./components/Check_good_information_1";
// import Check_good_dynamic_1 from "./components/Check_good_dynamic_1";
// import Check_manifest_1 from "./components/Check_manifest_1";
// import About from "./components/About";
// import Register from "./components/Register";
//
//2新建一页需要引入模板
//import News from './components/News'

// Vue.use(VueRouter);
Vue.use(ToastPlugin);

// // let baseURL = "http://172.17.0.42/dc-web"; //测试服务器
// let baseURL = "http://119.145.168.112:51042/dc-web"; //代理测试服务器

// Vue.use(AjaxPlugin);
// Vue.prototype.$http.defaults.baseURL = baseURL; //配置全部baseUrl

// let axiosInstance = axios.create({
//   baseURL: baseURL
// });
// // 添加响应拦截器
// axiosInstance.interceptors.response.use((response) => {
//   // 对响应数据做点什么
//   return response.data;
// }, function (error) {
//   // 对响应错误做点什么
//   return Promise.reject(error);
// });
Vue.prototype.$http = axiosInstance;

Vue.component("v-footer", Footer);
Vue.component("flexbox", Flexbox);
Vue.component("flexbox-item", FlexboxItem);
Vue.component("drawer", Drawer);
Vue.component("form-preview", FormPreview);
Vue.component("tab", Tab);
Vue.component("tab-item", TabItem);
Vue.component("timeline", Timeline);
Vue.component("TimelineItem", TimelineItem);
Vue.component("XButton", XButton);
Vue.component("XTextarea", XTextarea);
Vue.component("Group", Group);
Vue.component("cell", Cell);
Vue.component("x-input", XInput);
Vue.component("x-number", XNumber);
Vue.component("datetime", Datetime);
Vue.component("selector", Selector);
Vue.component("popup-picker", PopupPicker);
Vue.component("X-address", XAddress);
Vue.component("checker", Checker);
Vue.component("checker-item", CheckerItem);
Vue.component("divider", Divider);
Vue.component("popup", Popup);

// const routes = [
//   { path: "/", component: Home },
//   //3新建一页需要引入模板
//   //,{path: '/News', component: News }
//   { path: "/Login", component: Login },
//   { path: "/User", component: User },
//   { path: "/Record_infor", component: Record_infor },
//   { path: "/Mydeclare", component: Mydeclare },
//   { path: "/Mydeclare1", component: Mydeclare1 },
//   { path: "/Mydeclare_detail", component: Mydeclare_detail },
//   { path: "/About", component: About },
//   { path: "/News", component: News },
//   { path: "/News_detail", component: News_detail },
//   { path: "/Question_detail", component: Question_detail },
//   { path: "/Subscribe", component: Subscribe },
//   { path: "/Service", component: Service },
//   { path: "/Question", component: Question },
//   { path: "/Check", component: Check },
//   { path: "/Check_good_declare", component: Check_good_declare },
//   { path: "/Check_good_information", component: Check_good_information },
//   { path: "/Check_good_dynamic", component: Check_good_dynamic },
//   { path: "/Check_inspection", component: Check_inspection },
//   { path: "/Check_manifest", component: Check_manifest },
//   { path: "/Check_inspection_1", component: Check_inspection_1 },
//   { path: "/Check_good_declare_1", component: Check_good_declare_1 },
//   { path: "/Check_good_information_1", component: Check_good_information_1 },
//   { path: "/Check_good_dynamic_1", component: Check_good_dynamic_1 },
//   { path: "/Check_manifest_1", component: Check_manifest_1 },
//   { path: "/Register", component: Register }
// ];

// const router = new VueRouter({
//   routes
// });

FastClick.attach(document.body);

Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
  router,
  render: h => h(App)
}).$mount("#app-box");
